In [1]:
!date #last update


Mon Feb  8 01:52:35 CST 2016

Required:


In [ ]:
import os.path, gitpath #pip install git+'https://github.com/ruxi/python-gitpath.git'
os.chdir(gitpath.root()) # changes path to .git root
#os.getcwd() #check current work directory

Install Jekyll

by Ruxi

Feb 8, 2016

What is Jekyll? Its a static templating library enables blogging on github pages

It follows this directory structure


In [4]:
from IPython.display import IFrame
url = 'http://jekyllrb.com/docs/structure/'
IFrame(url, width=300, height=400)


Out[4]:

Instructions

sudo apt-get install ruby ruby-dev make gcc nodejs

(1) .gitignore __sites


In [55]:
# write files to .gitignore if not exist
with open('.gitignore', 'r+') as f:
    ignorelist = ['_sites']
    for path in ignorelist:
        if path in f.read():
            print('Found:\t"{}"\tmoving to next'.format(path))
        else:
            print('Not found:\t"{}"\twriting to file'.format(path))
            f.writelines("{}\n".format(path))


Found:	"_sites"	moving to next

In [60]:
!cat .gitignore


_sites

(2) _config.yml


In [ ]:
%%writefile _config.yml
name: Ruxi
markdown:

In [ ]:
Apprently karmdown is the only flavor of

Version control

Saving


In [57]:
py_commit_msg = """
write code cell to add file to .gitignore if not found
"""

In [58]:
%%bash -s "$py_commit_msg"
echo $1
git add --all :/
git commit -a -m "$1" #message from py_commit_msg
git push origin master


write code cell to add file to .gitignore if not found
[master a370bf0] write code cell to add file to .gitignore if not found
 6 files changed, 546 insertions(+), 134 deletions(-)
 delete mode 100644 .ipynb_checkpoints/Jekyll installation-checkpoint.ipynb
 delete mode 100644 Jekyll installation.ipynb
 create mode 100644 notebooks/.gitignore
 create mode 100644 notebooks/.ipynb_checkpoints/Install Jekyll-checkpoint.ipynb
 create mode 100644 notebooks/Install Jekyll.ipynb
To git@github.com:ruxi/ruxi.github.io.git
   1e560fa..a370bf0  master -> master

Pulling

git fetch --all
git pull origin master

In [ ]: